<div id="textareaBar" class="textarea-bar" style="display: none;">
	<textarea id="textareaBox" class="textarea-box" placeholder="请填写内容"></textarea>
	<div class="textarea-tool">
		<div class="textarea-btn" onclick="textarea_submit(getValue('textareaFlag'))">保存</div>
		<div class="textarea-btn2" onclick="closeTextareaBar()">取消</div>
	</div>
</div>
<input type="text" id="textareaFlag" class="display-none" />

<script type="text/javascript">
	document.onscroll = function() {
	    setDisplay('textareaBar', 'none');
	}

	function resetTextareaBarRect(parentObj, content, flag = '') {
        var parentRect = parentObj.getBoundingClientRect();
		var textareaBar = getItem('textareaBar');
		var textareaBox = getItem('textareaBox');

		textareaBar.style.left = parentRect.left + 'px';
        textareaBar.style.top = parentRect.top + 'px';
        textareaBar.style.width = parentRect.width - 5 + 'px';
        textareaBar.style.height = parentRect.height - 2 + 'px';

        textareaBox.style.width = parentRect.width - 5 + 'px';
        textareaBox.style.height = parentRect.height - 28 + 'px';
        textareaBox.value = content;

        textareaBox.addEventListener('keydown', function(event) {
        	if (event.key === 'Enter') {
        		event.preventDefault();
        		textarea_submit(getValue('textareaFlag'))
        	}
        });

        textareaBar.style.display = '';
        setValue('textareaFlag', flag);
        textareaBox.focus();
	}

	function closeTextareaBar() {
		setDisplay('textareaBar', 'none');
	}
</script>

<style type="text/css">
	.textarea-bar
    {
        background-color: white;
        position: fixed;
	    top: 0;
	    z-index: 93;
    }

    .textarea-box
    {
    	-webkit-flex: none;
    }

    .textarea-tool
    {
    	-webkit-flex: none;
    	background-color: white;
    	padding-left: 10px;
    	display: -webkit-flex;
	    -webkit-flex-direction: row;
	    -webkit-align-items: center;
    }

    .textarea-btn
    {
    	-webkit-flex: none;
	    color: #337ab7;
	    font-size: 13px;
	    margin-right: 20px;
	    cursor: pointer;
    }

    .textarea-btn2
    {
    	-webkit-flex: none;
	    color: #abacae;
	    font-size: 13px;
	    margin-right: 20px;
	    cursor: pointer;
    }
</style>